cmake_minimum_required(VERSION 3.0)
set(CMAKE_C_COMPILER gcc)
SET(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -Wall -g2 -ggdb")

project(libkcapi C)
project(libkcapi VERSION 1.5)
include_directories(include)

aux_source_directory(./src SOURCE_PATH)
add_library(kcapi_static STATIC ${SOURCE_PATH})
add_library(kcapi SHARED ${SOURCE_PATH})
add_executable(kcapi_test kcapi_test.c ${SOURCE_PATH})
set_target_properties(kcapi_static PROPERTIES OUTPUT_NAME  kcapi)
set_target_properties(kcapi PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties(kcapi_static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties(kcapi PROPERTIES VERSION 1.5 SOVERSION 1)
INSTALL(TARGETS kcapi kcapi_static LIBRARY DESTINATION lib
                                   ARCHIVE DESTINATION lib)
INSTALL(FILES include/kcapi.h DESTINATION include)
